﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System.ComponentModel.DataAnnotations;
using SpyApp.Models.BaseCommon.Enum;
using SpyApp.Models.EntytiRepossitory;


namespace SpyApp.Models
{
    public class User
    {
        [ScaffoldColumn(false)]
        [BsonId]
        public string Id { get; set; }              
        [Required, MaxLength(50)]
        public string PassWord { get; set; }
        public string UserName { get; set; }
        public bool RememberMe { get; set; }
        public int Age { get; set; }
        public int TotalLogin { get; set; }        
        public int TotalDeviceRegisted { get; set; }        
        public List<Device> SnDeviceRegisted { get; set; }        
        public List<Roles> UserInRoles { get; set; }        
        public string ActiveInvationCode { get; set;  }
        public DBEntity.UserStatus UserStatus { get; set; }
        public DBEntity.ObjectStatus Status {get;set;}
        public DateTime LastModifined { get; set; }
        public DBEntity.UserType UserType {get;set;}

        //public Device DeviceRegisted
        //{
        //    get
        //    {
        //        if (SnDeviceRegisted == null)
        //            SnDeviceRegisted = new List<Device>();
        //        return SnDeviceRegisted.LastOrDefault();
        //    }
        //    set
        //    {
        //        if(value != null)
        //            SnDeviceRegisted.Add(value);
        //    }
        //}

        
    } 
}